CC=gcc
MAKE=make
CFLAGS=-g
LIBS=-L. -ldb -L/usr/mysql/sql -lmysqlclient -lpthread -lm -lnsl -lresolv -lrt

all : mysql

mysql : dbcom.h dbfunc.h dbcom.c dbfunc.c
	$(CC) $(CFLAGS) -c -o dbcom.o dbcom.c
	$(CC) $(CFLAGS) -c -o dbfunc.o dbfunc.c

	ar -crl libdb.a dbcom.o dbfunc.o
	chmod 644 libdb.a 

test :
	$(CC) $(CFLAGS) -o test1 test1.c $(LIBS)
	chmod 744 test1
	$(CC) $(CFLAGS) -o test2 test2.c $(LIBS)
	chmod 744 test2

clean :
	rm -f core* *.o libdb.a test1 test2
